<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>捕获页面DOM内容</title>
    <script src="./res/jquery-3.5.1.min.js"></script>
</head>

<body>
    <button>我叫你的名字你敢答应吗</button>
    <div><label for="mobile">手机号</label><input type="text" id="mobile" value="15311484568" placeholder="请输入手机号" autocomplete="off"></div>
</body>

</html>
<script>
    $(function(e) {
        $('button').click(function(e) {
            e.preventDefault();
            // innerHTML
            window.console.log($('div').html());
            // innerText
            window.console.log($('div').text());
            // value
            window.console.log($('input').val());
        });
    });
</script>